<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel='stylesheet' href='/static/css/pluginsCss.css'/>
    <link rel='stylesheet' href='/static/css/plugins.css'/>
    <link rel='stylesheet' href='/static/css/luckysheet.css'/>
    <link rel='stylesheet' href='/static/css/iconfont.css'/>
    <script src="/static/js/plugin.js"></script>
    <script src="/static/js/luckysheet.umd.js"></script>
</head>
<body>
<div id="lucky" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 20px;"></div>
</body>
<script>
var options = {
  container: 'lucky',
  title: "demo",
  lang: 'zh',
  allowUpdate: true,
  loadUrl: "/luckysheet/api/loadUrl",
  updateUrl: `ws://${document.location.host}/luckysheet/api/updateUrl`,
  functionButton: '<button id="" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 85px;" onclick="testlog()">日志</button>',
}
$(function () {luckysheet.create(options)})
 
function testlog() {console.log(luckysheet.getAllSheets()[0]);
  debugger
  $.ajax({
       url: 'http://127.0.0.1:5001/test',
       method: 'POST',
       data: {exportdata: JSON.stringify(luckysheet.getAllSheets()[0])},
       });
  debugger
}
 
$(window).bind('unload', function() {
   $.ajax({
       url: 'http://127.0.0.1:5001/test',
       method: 'POST',
       data: {exportdata: JSON.stringify(luckysheet.getAllSheets()[0])},
       });
})
 
</script>
</html>